% ************************************************************************ 
%     Module name   : Lynx Simulation - Search Mode Run                                                     
%                                                                          
%     Description   : This will run the Search mode.                                                    
%                                                                          
%     $Header: /Lynx/SimulationFramework/RSP/IFS/IFSRun.m 2     15/10/08 16:08 Lwabeke $ 
%                                                                          
%    $Author: Lwabeke $	            
%                                                                         
%    $Revision: 2 $                
%                                                                         
% ************************************************************************
%     $History: IFSRun.m $ 
% 
%
% ************************************************************************
function pd = probability_detect(radarSetup, target, param)

switch (radarSetup.subMode)
    case 'NCI'
                pd = param.radarModes.searchMode.NCI.pd;
    case 'MTI'
                rVel = radialVel(target);
                
                pd = max(min(polyval(param.radarModes.searchMode.MTI.pd, abs(rVel)), 1), 0);
                
    case 'Stationary'
                rVel = radialVel(target);
                
                pd = max(min(polyval(param.radarModes.searchMode.Stationary.pd, abs(rVel)), 1), 0);
        
end


